#include<iostream>
#include<iomanip>
using namespace std;

int main()
{
    int s, v;
    cin >> s >> v;
    int t = (s + v - 1) / v + 10;
    int start = 8 * 60 - t;
    if (start < 0)
    {
        start += 24 * 60;
    }
    int hour = start / 60;
    int min = start % 60;
    cout << setw(2) << setfill('0') << hour << ':';
    cout << setw(2) << setfill('0') << min << endl;
    return 0;
}